<link rel="stylesheet" href="./css/swiper.css">
<link rel="stylesheet" href="./css/frame1.css?v=1.0.1">
<script src="./script/swiper.js"></script>
<style>
    #modal-wrap {
        z-index: 101;
    }
</style>
<div id="view" v-cloak>
    <header class="w-bg" id="fn-head">
        <ul class="h-wrap">
            <!-- 第二个头部 -->
            <li class="h-list hide">
                <div class="two flex-bt">
                    <!-- <span class="flex-c new new-invisible"  onclick="showNew(1);">最新发布</span> -->
                    <span class="flex-c new new-invisible">最新发布</span>
                    <div class="title">电台</div>
                    <!-- <span class="flex-c select-sex"  onclick="showNew(2);">不限性别</span> -->
                    <span class="flex-c select-sex" onclick="selectPost()">发布</span>
                </div>
            </li>
        </ul>
    </header>
    <div class="w-bg new-margin-b-10">
        <div class="m-swiper">
            <div class="swiper-container">
                <div class="swiper-wrapper">
                    <div class="swiper-slide" v-for="(m, index) in lbList" @click="_url(m.imginfo)">
                        <img :src="imgurl + m.img">
                    </div>
                    <!-- <div class="swiper-slide">
                            <img src="./image/test/01.jpg">
                        </div> -->
                </div>
                <!-- Add Pagination -->
                <div class="swiper-pagination"></div>
                <!-- Initialize Swiper -->
            </div>
        </div>
        <ul class="classfiy_ul">
            <li class="li" v-for="(m, index) in themeList"
                @click="_url({category_id:m.id, url:'frame1_more', title:m.name})">
                <div class="img-wrap">
                    <img class="img" :src="imgurl + m.image" onerror="this.onerror=null;this.src='./image/error-img.png'" />
                </div>
                <aside>{{ m.name }}</aside>
            </li>
        </ul>
    </div>
    <div class="filter w-bg">
        <!-- 筛选条件 -->
        <ul class="filter-wrap flex-a">
            <li class="f-list flex-c" id="time" onclick="selectFilter('time')">
                <span class="time">最新发布</span>
                <i class="aui-iconfont aui-icon-down"></i>
            </li>
            <li class="f-list flex-c" id="sex" onclick="selectFilter('sex')">
                <span class="sex">不限性别</span>
                <i class="aui-iconfont aui-icon-down"></i>
            </li>
            <li class="f-list flex-c" id="city" onclick="_showCity()">
                <span class="city">不限地区</span>
                <i class="aui-iconfont aui-icon-down"></i>
            </li>
        </ul>
        <!-- <p class="frame1_notice" style="font-size: 12px;">健康约会，请勿广播低俗内容及联系方式，一经发现将作删除处理</p> -->
    </div>
    <!-- 官方广播 -->
    <ul class="wrap">
        <li class="list" v-for="(m, index) in sysList" v-if="index == 0">
            <div class="flex-bt" style="align-items:flex-start;">
                <div class="left flex">
                    <div class="tx img-h">
                        <img src="./image/logo.png" alt="">
                        <!-- <i class="base-icon dy-male-icon"></i> -->
                    </div>
                    <div>
                        <div class="name-wrap flex">
                            <span class="name">{{m.name}}</span>
                            <span class="sys-tag tag">官方</span>
                        </div>
                        <span class="time">{{m.addtime}}</span>
                    </div>
                </div>
                <div class="more flex-c new-invisible">
                    <i class="aui-iconfont aui-icon-more"></i>
                </div>
            </div>
            <div class="dy-content-wrap new-padding-10">
                <div class="tri"></div>
                <ul class="ul">
                    <li class="li" v-if="m.content">
                        <i class="base-icon dy-content-icon"></i>
                        <div class="dy-content">{{clearHtml(m.content)}}</div>
                    </li>
                    <li class="li" v-if="m.datetime">
                        <i class="base-icon dy-time-icon"></i>
                        <div class="dy-content">{{m.datetime}}</div>
                    </li>
                    <li class="li" v-if="m.citys">
                        <i class="base-icon dy-area-icon"></i>
                        <div class="dy-content">{{m.citys}}</div>
                    </li>
                </ul>
                <div class="img-wrap flex-w" v-if="m.sumbImage && m.sumbImage.length > 0 && m.sumbImage[0]">
                    <div class="img img-h" v-for="(s, sindex) in m.sumbImage"
                        @click="_url({imgArr:m.masterimg, iIndex:sindex, url: 'frame1/dy_img', title: '查看图片'})">
                        <img :src="imgurl+s" @load="imgCss(imgurl+s, $event)" onerror="this.onerror=null;this.src='./image/error-img.png'"
                            alt="">
                    </div>
                </div>
            </div>
        </li>
    </ul>
    <!-- 个人广播 -->
    <ul class="wrap">
        <li class="list" v-for="(m, index) in ffList" @click="_url({id:m.dy_id, url:'frame1/dy_detail', title:'详情'})">
            <div class="flex-bt" style="align-items:flex-start;">
                <div class="left flex">
                    <div class="tx flex-c img-h" @click.stop @click="go_userInfo(m.id, m.name, m.sex)">
                        <img :src="imgurl+m.head_100" @load="imgCss(imgurl+m.head_100, $event)" onerror="this.onerror=null;this.src='./image/touxiang.png'" alt="">
                        <i class="base-icon dy-male-icon" v-if="m.sex == '男'"></i>
                        <i class="base-icon dy-female-icon" v-if="m.sex == '女'"></i>
                    </div>
                    <div>
                        <div class="name-wrap flex">
                            <span class="name">{{m.name}}</span>
                            <span v-if="m.nvshen" class="girl-tag tag"></span>
                            <span v-if="m.is_identity_authentication == 2" class="real-tag tag"></span>
                            <span v-if="m.is_vip >0" class="vip-tag tag"></span>
                        </div>
                        <span class="time">{{m.addtime}}</span>
                    </div>
                </div>
                <!-- <div class="more flex-c" @click.stop="more(m.dy_id);">
                        <i class="aui-iconfont aui-icon-more"></i>
                    </div> -->
            </div>
            <div class="dy-content-wrap new-padding-10">
                <div class="tri"></div>
                <ul class="ul">
                    
                    <li class="li">
                        <i class="base-icon dy-theme-icon"></i>
                        <div class="dy-content">{{themeObj[m.category_id]}}</div>
                    </li>
                    <li class="li" v-if="m.datetime">
                        <i class="base-icon dy-time-icon"></i>
                        <div class="dy-content">{{m.datetime}}</div>
                    </li>
                    <li class="li" v-if="m.call">
                        <i class="base-icon dy-person-icon"></i>
                        <div class="dy-content">{{m.call}}</div>
                    </li>
                    <li class="li" v-if="m.filter">
                        <i class="base-icon dy-money-icon"></i>
                        <div class="dy-content" v-if="m.filter != '不限'">￥{{m.filter}}</div>
                        <div class="dy-content" v-else>{{m.filter}}</div>
                    </li>
                    <li class="li" v-if="m.citys">
                        <i class="base-icon dy-area-icon"></i>
                        <div class="dy-content">{{m.citys}}</div>
                    </li>
                    <li class="li" v-if="m.content">
                        <i class="base-icon dy-content-icon"></i>
                        <div class="dy-content">{{m.content}}</div>
                    </li>
                </ul>
                <div class="img-wrap flex-w" v-if="m.sumbImage && m.sumbImage.length > 0 && m.sumbImage[0]">
                    <div class="img img-h" v-for="(s, sindex) in m.sumbImage" @click.stop
                        @click="_url({imgArr:m.masterimg, iIndex:sindex, url: 'frame1/dy_img', title: '查看图片'})">
                        <img :src="imgurl+s" @load="imgCss(imgurl+s, $event)" onerror="this.onerror=null;this.src='./image/error-img.png'"
                            alt="">
                    </div>
                </div>
            </div>
            <div class="footer">
                <ul class="ul flex-a">
                    <li class="li" @click.stop @click="zan(m.dy_id, index)">
                        <i class="base-icon dy-nozan-icon" :class="{'dy-zan-icon':m.isthumbsup == 1}"></i>
                        <span>{{ m.num }}</span>
                    </li>
                    <!-- <li class="li" v-if="m.id != myuserid" @click.stop @click="addComment(m.dy_id, m.id)">
                        <i class="base-icon dy-comment-icon"></i>
                        <span>评论</span>
                    </li> -->
                    <li class="li" >
                        <i class="base-icon dy-comment-icon"></i>
                        <span>评论</span>
                    </li>
                    <li class="li" v-if="myuserid != m.id && m.type == 1" @click.stop
                        @click="joinEnroll(m.dy_id, index)">
                        <i class="base-icon dy-nobaoming-icon" :class="{'dy-baoming-icon':m.self_enroll == 1}"></i>
                        <span v-if="m.self_enroll == 0">我要报名({{m.enroll}})</span>
                        <span v-if="m.self_enroll == 1" style="color: #673AB7;">取消报名({{m.enroll}})</span>
                    </li>
                    <li class="li" v-if="myuserid == m.id  && m.type == 1">
                        <i class="base-icon dy-nobaoming-icon"></i>
                        <span>报名人数({{m.enroll}})</span>
                    </li>
                </ul>
            </div>
            <div class="over" v-if="m.overdue == 1"></div>
        </li>
        <div id="no_more"></div>
    </ul>
    <div class="input-bg new-hide">
        <div class="input-wrap">
            <input type="text" placeholder="说点什么">
            <button class="send-btn" @click.stop="send()">发送</button>
        </div>
    </div>
    <div class="new-hide" id="modal-wrap"></div>
</div>
<script src="./script/area.js?v=1.0.1"></script>
<script src="./script/frame1.js?v=1.0.1"></script>
<script>
    getData(0);
    getLunbo();
    getTheme();
    getSysDynamic();

    // 获取轮播图
    function getLunbo() {
        _ajax('home/user/lunbo', function (ret, err) {
            if (ret && ret.code == 200 && ret.result && ret.result.length > 0) {
                view.lbList = ret.result;
                setTimeout(function(){
                    var swiper = new Swiper('.swiper-container', {
                        loop: true,
                        pagination: {
                            el: '.swiper-pagination',
                            clickable: true,
                        },
                        autoplay: {
                            delay: 5000,
                            stopOnLastSlide: false,
                            disableOnInteraction: false,
                        },
                    });
                }, 1000)
            }
        })
    }

    // 获取系统广播
    function getSysDynamic() {
        _ajax('home/dymanic/sysdymanic', function (ret, err) {
            if (ret && ret.code == 200 && ret.result && ret.result.length > 0) {
                view.sysList = ret.result;
            }
        })
    }

    // 选择发布的类型
    function selectPost() {
        // var buttons = ['普通约会', '报名约会'];
        // var typeArr = [0, 1];
        // _action('', buttons, function (index) {
        //     if (index != (buttons.length + 1)) {
        //         _url({
        //             type: typeArr[index - 1],
        //             url: 'frame1/fa_bu_yue_hui',
        //             title: '发布约会'
        //         });
        //     }
        // })
        $('#modal-wrap').removeClass('new-hide');
        _load('#modal-wrap', 'frame1/theme_modal');
    }
</script>